Skip to content

Refining the fuzz generator#2975

Merged
DariaBod merged 10 commits intodevelopfrom
fb_fixFuzzGenerator
May 5, 2026
Merged

Refining the fuzz generator#2975
DariaBod merged 10 commits intodevelopfrom
fb_fixFuzzGenerator

Conversation

@DariaBod
Copy link
Copy Markdown
Contributor

@DariaBod DariaBod commented May 4, 2026

Rationale

Fuzz generator made our tests to fail intermittent because of several things: double spaces, repeat characters, Selenium special characters.

Related Pull Requests

Changes

  • Backslash excluded because Selenium can mess if read it from UI
  • Attempts count added to randomTextChoice
  • containsKey+put → computeIfAbsent
  • Random() and Math.random() changed to ThreadLocalRandom

>= instead of >
fix comment
Copy link
Copy Markdown
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should focus on whitespace and repeated characters for now.
I'm not ready to exclude backslashes from our fuzz testing. It is one of the mostly likely characters to cause problems and should be a prime target for fuzz testing.
If there is a bug in Selenium, we need to open an issue.

Comment thread src/org/labkey/test/util/TestDataGenerator.java Outdated
{
if (++attempts >= MAX_RANDOM_TRIES)
throw new IllegalStateException("Failed to generate " + size + " unique text choices after " + MAX_RANDOM_TRIES + " attempts");
String generated = randomString(randomInt(1, 25), ";").trim();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in the last PR. Why are we excluding ; from text choices?
If it is a valid character, we should include it.

Copy link
Copy Markdown
Contributor Author

@DariaBod DariaBod May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/LabKey/internal-issues/issues/1096#issuecomment-4331544773
It breaks MVTC conversion tests. I can create a separate method without semicolon for conversion tests. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say we should have a separate method for those tests. Or maybe have the conversion tests adjust their expectations depending on whether the choices have semicolons or not.

DariaBod and others added 2 commits May 5, 2026 09:35
Co-authored-by: Trey Chadick <tchad@labkey.com>
@DariaBod DariaBod requested a review from labkey-tchad May 5, 2026 18:36
@DariaBod DariaBod merged commit 9899c80 into develop May 5, 2026
5 of 6 checks passed
@DariaBod DariaBod deleted the fb_fixFuzzGenerator branch May 5, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants